#ifndef PRODUCTIO_H
#define PRODUCTIO_H
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include "HardDisk.h"
#include "Monitor.h"
#include "Product.h"
#include "SDCard.h"
#include "Software.h"
#include "Stock.h"
#include "USB.h"
using namespace std;

class ProductIO
{
public:

	/* Constructor for Product IO */
	ProductIO(string path);

	/* Destructor for Product IO */
	~ProductIO();

	/* Print All Items in the Console */
	void viewRecord(const Stock &stock);

	/* Load data and Create Object into Vector List */
	void loadDataFromFile(vector<Product *> &productList);

	/* Write All Items to Text File (e.g. Product.txt) */
	void commitChanges(const Stock &stock);

private:
	string filePath;
	ifstream inputFileStream;
	ofstream outputFileStream;

	/* Display Error Message for Transaction IO */
	void displayErrorMessage(string errorMsg);

};

#endif
